#现代鸡兔同笼
m,n =map(int,input().split())
i ,flag= 0,0
if m<0 or n<0:
    print("Data Error!")
for i in range(0,m+1,1):
    if i*2+(m-i)*4 == n:
        print(f'有{i}只鸡，{m-i}只兔')
        flag = 1
        break
if flag == 0:
    print("Data Error!")
